<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    {load file='/static/css/bootstrap.css'}
    {load file='/static/css/all.css'}
    {load file='/static/css/style.css'}
    {load file='/static/js/jquery-3.4.1.min.js'}
    {load file='/static/js/popper.js'}
    <!--<script src="https://cdn.staticfile.net/popper.js/1.15.0/umd/popper.min.js"></script>-->
    {load file='/static/js/bootstrap.js'}
    {load file='/static/js/bootbox.js'}
    <style type="text/css">
        body{background-color: rgba(250, 250, 240, 0.7)}
        .btn{
            width: 80px; /* 设置按钮宽度为 80 像素，可根据实际需求调整数值 */
            height: 30px; /* 设置按钮高度为 30 像素，可根据实际需求调整数值 */
            font-size: 12px; /* 同时可以适当调小按钮文字的字体大小，让整体更协调 */
            padding: 5px 10px;
        }
    </style>
</head>
<body>
<div class="container-furid" style="padding: 0px">
    <div class="row" style="padding-left: 20px">
        <form class="form-inline" action="" style="margin: 10px 0">

            <input id="key" type="text" class="form-control" name="key"  placeholder="医生姓名">&nbsp;&nbsp;

            <button type="submit" class="btn btn-primary" id="search"><span class="fa fa-search"></span>&nbsp;&nbsp;搜索</button>
        </form>
    </div>
    <table class="table table-hover">
        <tr><th>id</th><th>姓名</th><th>性别</th><th>年龄</th><th>看诊医生</th><th>病情</th><th>状态</th><th>预约时间</th><th>操作</th></tr>
        {volist name='m3' id='v'}
        <tr><td>{$v.patientid}</td><td>{$v.patientname}</td><td>{$v.sex}</td><td>{$v.age}</td><td>{$v.doctorname}</td><td>{$v.patientstate}</td><td>{$v.state}</td><td>{$v.rtime}</td>
            {if($v.state=='未看诊')}
            <td><button class="btn btn-danger" onclick="del({$v.num})"><span class="fa fa-trash-alt"></span>&nbsp;删除</button></td>
            {else}
            <td>无法操作</td>
            {/if}
        </tr>
        {/volist}
    </table>
    {$m3|raw}
</div>
</body>
</html>
<script>
    function del(id){
        bootbox.confirm("确实要删除该记录吗",function(res){
            if(res){
                $.get("/index.php/hospital/patientreserveee/del",{'id':id},function(res1){
                    if(res1==1){
                        bootbox.alert("删除记录成功",function(){
                            window.location.reload();
                        })
                    }
                })
            }
        })
    }
</script>

